<template>
  <div class="test">
    <img :src="imagesrc"/>
    <!-- TODO here how to upload file ??  -->
    <!-- <input ref="input" type="file"/>
	 <button @click="onSubmitFile">Submit</button> -->

    <!-- <GoodsAdd text="click me to add" /> -->
    <SearchBar/>
    <SearchType/>
  </div>
</template>

<script lang="ts" setup>
 import { onMounted, ref, provide } from "@vue/runtime-core";
 import Axios from 'axios'
 import {ImageUploadService, GoodsTypeService} from '@/service'
 import SearchBar from '@/components/SearchBar.vue'
 import SearchType from '@/components/SearchType.vue'
import GoodsAdd from '@/components/GoodsAdd.vue'
 
 const imagesrc = ref('')
 const input = ref<HTMLInputElement>()
 const goodsTypes = ref<Array<GoodsType>>([])
 


 function onSubmitFile() {
   console.log('obsubmitFile')
   let data = input.value!.files![0]
   ImageUploadService.upload(data)
 }


</script>